home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / SYS / s / Arexx_Demo.rush < prev    next >
Text File  |  1996-09-26  |  4KB  |  178 lines

  1. /*
  2. ** $VER: Arexx_Demo.rush 37.1 (22.1.94)
  3. **
  4. ** Show some of Rush's Arexx functions
  5. **
  6. ** Written by Douglas Keller
  7. */
  8.  
  9. if( address() == "REXX" ) then address "RUSH.1"
  10.  
  11. options results
  12.  
  13. LF = '0a'x
  14.  
  15. demotext =                "Welcome to the Rush Arexx Demo, this demo will\n"
  16. demotext =    demotext || "show some of the things Rush can do from Arexx.\n"
  17. demotext =    demotext || "\n"
  18. demotext =    demotext || "Would you like to run the demo?"
  19.  
  20. 'Requester "Run Demo|Cancel" "' || demotext || '"'
  21. if( result == 1 ) then do
  22.  
  23.     /*
  24.     ** Cycle Colors
  25.     */
  26.     'Requester "Continue" "First we will cycle the background color"'
  27.  
  28.     'GetPalette pen=0'
  29.     old_pen = result
  30.  
  31.     parse var old_pen "pen=" pen "red=" r "green=" g "blue=" b
  32.  
  33.     x = "0123456789ABCDEF"
  34.  
  35.     /* convert from hex to dec */
  36.     start =  pos(substr(r, 3, 1), x) - 1
  37.  
  38.     do i = start to 0 by -1
  39.         r = "0x" || insert("","",0,8,substr(x, i+1, 1))
  40.  
  41.         'SetPalette pen=0 red' r 'green' g 'blue' b
  42.         'StatusMsg "pen=0 red' r 'green' g 'blue' b '"'
  43.     end
  44.  
  45.     do i = 1 to 15
  46.         r = "0x" || insert("","",0,8,substr(x, i+1, 1))
  47.  
  48.         'SetPalette pen=0 red' r 'green' g 'blue' b
  49.         'StatusMsg "pen=0 red' r 'green' g 'blue' b '"'
  50.     end
  51.  
  52.     do i = 14 to start by -1
  53.         r = "0x" || insert("","",0,8,substr(x, i+1, 1))
  54.  
  55.         'SetPalette pen=0 red' r 'green' g 'blue' b
  56.         'StatusMsg "pen=0 red' r 'green' g 'blue' b '"'
  57.     end
  58.  
  59.     do i = start to 0 by -1
  60.         g = "0x" || insert("","",0,8,substr(x, i+1, 1))
  61.  
  62.         'SetPalette pen=0 red' r 'green' g 'blue' b
  63.         'StatusMsg "pen=0 red' r 'green' g 'blue' b '"'
  64.     end
  65.  
  66.     do i = 1 to 15
  67.         g = "0x" || insert("","",0,8,substr(x, i+1, 1))
  68.  
  69.         'SetPalette pen=0 red' r 'green' g 'blue' b
  70.         'StatusMsg "pen=0 red' r 'green' g 'blue' b '"'
  71.     end
  72.  
  73.     do i = 14 to start by -1
  74.         g = "0x" || insert("","",0,8,substr(x, i+1, 1))
  75.  
  76.         'SetPalette pen=0 red' r 'green' g 'blue' b
  77.         'StatusMsg "pen=0 red' r 'green' g 'blue' b '"'
  78.     end
  79.  
  80.     do i = start to 0 by -1
  81.         b = "0x" || insert("","",0,8,substr(x, i+1, 1))
  82.  
  83.         'SetPalette pen=0 red' r 'green' g 'blue' b
  84.         'StatusMsg "pen=0 red' r 'green' g 'blue' b '"'
  85.     end
  86.  
  87.     do i = 1 to 15
  88.         b = "0x" || insert("","",0,8,substr(x, i+1, 1))
  89.  
  90.         'SetPalette pen=0 red' r 'green' g 'blue' b
  91.         'StatusMsg "pen=0 red' r 'green' g 'blue' b '"'
  92.     end
  93.  
  94.     do i = 14 to start by -1
  95.         b = "0x" || insert("","",0,8,substr(x, i+1, 1))
  96.  
  97.         'SetPalette pen=0 red' r 'green' g 'blue' b
  98.         'StatusMsg "pen=0 red' r 'green' g 'blue' b '"'
  99.     end
  100.  
  101.     'SetPalette ' || old_pen
  102.     'StatusMsg " "'
  103.  
  104.  
  105.     /*
  106.     ** String requester / status msg
  107.     */
  108.     'Requester "Continue" "Next you will be asked to type in a string.\n\nThe string will also be shown in the status area."'
  109.  
  110.     'StringRequester "Enter your name:" ""'
  111.  
  112.     'StatusMsg "Your name is:' result '"'
  113.  
  114.     /*
  115.     ** Load some directories and select some stuff
  116.     */
  117.     'Requester "Continue" "Next we will load a couple of directories and\nselect some files and get the selected files\nfrom Rush.\n\nOn the left we will load SYS: and on the right C:."'
  118.  
  119.     'GetPattern'
  120.     old_pat=result
  121.  
  122.     'SetActiveSide LEFT'
  123.     'SetDirectory "sys:"'
  124.     'SetPattern "#?a#?"'
  125.     'All'
  126.  
  127.     'SetActiveSide OTHER'
  128.     'SetDirectory "c:"'
  129.     'SetPattern "d#?"'
  130.     'All'
  131.  
  132.     selected = "Files that were selected\n\nOn left:"
  133.  
  134.     'SetActiveSide LEFT'
  135.     do while (1)
  136.         'GetSelected'
  137.         if result == "" then break
  138.         selected = selected || "\n    " || result
  139.     end
  140.  
  141.     selected = selected || "\n\nOn right:"
  142.  
  143.     'SetActiveSide RIGHT'
  144.     do while (1)
  145.         'GetSelected'
  146.         if result == "" then break
  147.         selected = selected || "\n    " || result
  148.     end
  149.  
  150.     'Requester "Continue" "' || selected || '"'
  151.  
  152.     'SetPattern "' || old_pat || '"'
  153.  
  154.     /*
  155.     ** Do some screenmode stuff
  156.     */
  157.     'Requester "Continue" "Next we will try some different\nscreen modes from Arexx."'
  158.  
  159.     'GetScreenMode'
  160.     old = result
  161.  
  162.     'SetScreenMode WB LEFT=0 TOP=0 WIDTH=500 HEIGHT=150'
  163.     address command "wait 1"
  164.  
  165.     'Requester "Continue" "Window on Workbench"'
  166.  
  167.     'SetScreenMode ID=0x00000000 LEFT=0 TOP=0 WIDTH=640 HEIGHT=200'
  168.     address command "wait 1"
  169.  
  170.     'Requester "Continue" "Back to a custom screen in LowRes"'
  171.  
  172.     'SetScreenMode ' || old
  173.     address command "wait 1"
  174.  
  175.     'Requester "Continue" "All done"'
  176.  
  177. end
  178.